#ifndef _CPUCTRL_H_
#define _CPUCTRL_H_

#include <cpuctrl_t.h>
#include <spinlock_t.h>

/* 自旋锁操作 */

void spinlock_init (spinlock_t * lock);
void spinlock_lock (spinlock_t * lock);
void spinlock_unlock (spinlock_t * lock);

/* 中断禁止与恢复 */

void irq_disable_savecpuflg (cpuflg_t * cpuflg);
void irq_enable_restcpuflg (cpuflg_t * cpuflg);

/* 带中断控制的自旋锁操作 */

void spinlock_saveflg_cli (spinlock_t * lock, cpuflg_t * cpuflg);
void spinunlock_restflg_sti (spinlock_t * lock, cpuflg_t * cpuflg);

/* 系统崩溃 */

void hal_system_is_die (char_t * errmsg);

#endif
